/**
 * @desc 平安考勤
 */
import fetch from 'utils/fetch';

//1. 原始数据分页查询
export function listRawData(schoolId, punch, devicePosition, attendanceCardNum, startTime, endTime, deviceType, page, rows) {
    const data = {
        schoolId,
        punch,
        devicePosition,
        attendanceCardNum,
        startTime,
        endTime,
        deviceType,
        page,
        rows
    }
    return fetch({
        url: '/rawdata/listRawData',
        method: 'post',
        data
    });
}

//原始数据-设备定位下拉
export function listDevice() {
    return fetch({
        url: '/rawdata/listDevice',
        method: 'post'
    })
}

//学生考勤-学生考勤时间段
export function listStundetAttendance(date, fSchoolId) {
    const data = {
        date,
        fSchoolId
    }
    return fetch({
        url: "/checkinfo/listStundetAttendance",
        method: "post",
        data
    })
}

//学生考勤-学生考勤分页
export function pageStundetCheckinfo(searchDate, schoolId, gradeId, classId, studentName, attendanceTimeId, page, rows) {
    const data = {
        searchDate,
        schoolId,
        gradeId,
        classId,
        studentName,
        attendanceTimeId,
        page,
        rows
    }
    return fetch({
        url: `/checkinfo/pageStundetCheckinfo/${page}/${rows}`,
        method: "post",
        data
    })
}

// //教师考勤分页
export function pageTeacherCheckinfo(searchDate, schoolId, teacherName, cardNum, page, rows) {
    const data = {
        searchDate,
        schoolId,
        teacherName,
        cardNum,
        page,
        rows
    }
    return fetch({
        url: `/checkinfo/pageTeacherCheckinfo/${page}/${rows}`,
        method: "post",
        data
    })
}

//考勤报表-学生
export function listStundetCheckinfoReport(searchDate, schoolId, gradeId, classId) {
    const data = {
        searchDate,
        schoolId,
        gradeId,
        classId
    };
    return fetch({
        url: "/checkinfoReport/listStundetCheckinfoReport",
        method: "post",
        data
    })
}
//考勤报表-教师
export function teacherCheckinfoReport(searchDate, schoolId) {
    const data = {
        searchDate,
        schoolId
    };
    return fetch({
        url: "/checkinfoReport/teacherCheckinfoReport",
        method: "post",
        data
    })
}

//学生考勤分页
export function pageStudentCheckinfoCount(startDay, endDay, schoolId, classId, gradeId, studentName, page, rows) {
    const data = {
        startDay,
        endDay,
        schoolId,
        classId,
        gradeId,
        studentName,
        page,
        rows
    };
    return fetch({
        url: `/checkinfo/pageStudentCheckinfoCount/${page}/${rows}`,
        method: "post",
        data
    })
}

//开通考勤日期

export function findSchoolFirstAttendance(fSchoolId, sType) {
    const data = {
        fSchoolId,
        sType
    };
    return fetch({
        url: "/checkinfo/findSchoolFirstAttendance",
        method: "post",
        data
    })
}

// 教师考勤分页

export function pageTeacherCheckinfoCount(startDay, endDay, schoolId, teacherName, page, rows, isBindCard) {
    const data = {
        startDay,
        endDay,
        schoolId,
        teacherName,
        page,
        rows,
        isBindCard
    };
    return fetch({
        url: `/checkinfo/pageTeacherCheckinfoCount/${page}/${rows}`,
        method: "post",
        data
    })
}

//学生考勤报表详情
export function studentCheckinfoReportDetail(searchDate, schoolId, attendanceTimeId, gradeId, classId, type, page, rows) {
    const data = {
        searchDate,
        schoolId,
        attendanceTimeId,
        gradeId,
        classId,
        type,
        page,
        rows
    };
    return fetch({
        url: `/checkinfoReport/studentCheckinfoReportDetail/${page}/${rows}`,
        method: "post",
        data
    })
}

// 巡查模式打卡分页
export function listSerach(json) {
    const data = {...json };
    return fetch({
        url: `/Serach/listSerach`,
        method: "post",
        data
    })
}